import { Entity } from "../../../../../Core/Module/Entity/Entity";
import { IAwake2 } from "../../../../../Core/Module/EventSystem/IAwakeSystem";
import { IDestroy } from "../../../../../Core/Module/EventSystem/IDestroySystem";
import { IPEndPoint } from "../../../../../Core/System/IPEndPoint";
import { Dictionary } from "../../../../../Support/Share/Lib/Dictionary";
import { RouterNode } from "./RouterNode";
import { IUpdate } from "../../../../../Core/Module/EventSystem/IUpdateSystem";

export class RouterComponent extends Entity implements IAwake2<IPEndPoint, string>, IDestroy, IUpdate {
    public OuterSocket;
    public InnerSocket;
    public IPEndPoint = new IPEndPoint("", 0);

    public Cache = [];

    public ConnectIdNodes = new Dictionary<number, RouterNode>();

    // 已经连接成功的，虽然跟id一样，但是没有经过验证的不会加到这里
    public OuterNodes = new Dictionary<number, RouterNode>();

    public LastCheckTime: number = 0;
}